<!-- Liste des réservations -->
<h1><?php echo $this->pageTitle; ?></h1>
<?php $dateBegin = new Zend_Date(); ?>
<?php $dateEnd   = new Zend_Date(); ?>

<!-- Liste des réservations -->
<div id="reservationlist">
<table>
  <tr>
    <th><?php echo $this->translate("Salle"); ?></th>
    <th><?php echo $this->translate("Horaires"); ?></th>
    <th><?php echo $this->translate("Utilisation"); ?></th>
    <th><?php echo $this->translate("Responsable"); ?></th>
    <th>Actions</th>
  </tr>
<?php foreach ($this->reservations as $reservation) : ?>
<?php $dateBegin->set($reservation['date_begin'], 'YYYY-MM-DD HH:mm:ss', 'fr_FR'); ?>
<?php $dateEnd->set($reservation['date_end'], 'YYYY-MM-DD HH:mm:ss', 'fr_FR'); ?>
  <tr>
    <td><?php echo $reservation['room']; ?></td>
    <td>du <?php echo $dateBegin->toString('dd MMMM à HH:mm'); ?>
      <br />au <?php echo $dateEnd->toString('dd MMMM à HH:mm'); ?></td>
    <td><?php echo $reservation['usage']; ?></td>
    <td><?php echo $reservation['user']; ?></td>
    <td align="center">
      <a href="<?php echo $this->link('reservation', 'delete'); 
      ?>/r/<?php echo $reservation['id_reservation']; 
      ?>">delete</a> | 
      <a href="<?php echo $this->link('reservation', 'edit'); 
      ?>/r/<?php echo $reservation['id_reservation']; 
      ?>">edit</a>
    </td>
  </tr>
<?php endforeach; ?>
</table>

<!-- Pagination display -->
<?php echo $this->reservations; ?>

<!-- informations -->
<p>
<?php if ($this->cached) : ?>
  <?php echo $this->translate("résultats provenant du cache"); ?>
<?php else : ?>
  <?php echo $this->translate("résultats provenant de la base de données (pas en cache)"); ?>
<?php endif; ?>
 | <?php echo $this->translate("les données de cette page dans d'autres formats"), ':';
         foreach (array('csv','json','xml') as $format) {
             echo '<a href="', $this->link(null, null, null, array('format'=>$format), 'reservations'), '">',$format,'</a> | ';
         }
   ?>
</p>
</div>